package com.serviceImpl;

import com.javabean.Orders;
import com.mapper.OrdersMapper;
import com.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @Author: 张波
 * @Time: 2025/8/27 18:58
 */
@Service
public class OrdersServiceImpl implements OrdersService {
	OrdersMapper ordersMapper;

	@Autowired
	public OrdersServiceImpl(OrdersMapper ordersMapper) {
		this.ordersMapper = ordersMapper;
	}


	/**
	 *
	 * @return 返回查询到的所有数据
	 */

	@Override
	public List<Orders> findAll() {
		return ordersMapper.selectAll();
	}

	/**
	 *
	 * @param orderNum 订单编号
	 * @param productName 产品名称
	 * @return 返回模糊查询到的结果
	 */
	@Override
	public List<Orders> findAllByOrderNumAndProductName(String orderNum, String productName) {
		return ordersMapper.selectAllByOrderNumAndProductName(orderNum,productName);
	}

	@Override
	 public Orders findById(int id) {
		return ordersMapper.selectById(id);
	}
}
